package fr.mywiki.business.account;

import fr.mywiki.business.profil.Profile;
import fr.mywiki.model.ejbAdapter.Value;

/** Represents a member of the application. */
public class AccountLite extends Value {
	private static final long serialVersionUID = 1L;

	/** The type of this object */
	public static final String TYPE_ENT = "account";
	
	/* The fields constants */
	public static final String FIELD_LOGIN = "login";
	public static final String FIELD_PASSWORD = "password";
	public static final String FIELD_PROFILE = "profile";
	
	/* The links constants */
	public static final String LINK_ACCOUNT_STRUCTURE = "structureId";
	
	/* The fields */
	/** The login of the account */
	private String login;
	/** The (coded) password of the account */
	private String password;
	/** The profile of the account */
	private Profile profile;
	
	public String getTypeEnt() {
		return TYPE_ENT;
	}
	
	public Object get(String attName) {
		if (FIELD_LOGIN.equals(attName))
			return getLogin();
		if (FIELD_PASSWORD.equals(attName))
			return getPassword();
		if (FIELD_PROFILE.equals(attName))
			return getProfile();
		return null;
	}
	public void set(String attName, Object value) {
		if (FIELD_LOGIN.equals(attName))
			setLogin((String)value);
		else if (FIELD_PASSWORD.equals(attName))
			setPassword((String)value);
		else if (FIELD_PROFILE.equals(attName))
			setProfile((Profile) value);
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Profile getProfile() {
		return profile;
	}

	public void setProfile(Profile profile) {
		this.profile = profile;
	}
}
